﻿<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>成本销账</title>
    <link rel="stylesheet" type="text/css" href="../Content/Css/OperaMasksUI/default/om-all.css" />
    <link rel="stylesheet" type="text/css" href="../Content/Css/list.css" />
    <script type="text/javascript" src="../Scripts/jquery.1.6.3.min.js"></script>
    <script type="text/javascript" src="../Scripts/json2.js"></script>
    <script type="text/javascript" src="../Scripts/common.js"></script>
    <script type="text/javascript" src="../Scripts/OperaMasksUI/operamasks-ui.min.js"></script>
    <script type="text/javascript" src="../Scripts/Plugin/jquery.form.js"></script>
    <script type="text/javascript" src="../Scripts/Plugin/artDialog4.1.7/jquery.artDialog.js?skin=default"></script>
    <script type="text/javascript" src="../Scripts/Plugin/artDialog4.1.7/plugins/iframeTools.js"></script>
    <script type="text/javascript" src="../Scripts/banBackSpace.js"></script>
    <script type="text/javascript">
        var validatorForm, submitForm, detailForm;
        var actionRoot = "../handler/ajax.ashx?type=AjaxSystem", comboxBankData = [], comboxTypeData = [];

        $(document).ready(function () {
            detailForm = $('#viewForm');
            //加载付款方式
            $.ajax({
                cache: false, async: false,
                url: '../Handler/combox.ashx?type=other&view=SELECT PayTypeCode,PayTypeName FROM vPayType ',
                dataType: 'json', type: 'post',
                beforeSend: function () {
                    $.omMessageBox.waiting({
                        title: '请等待',
                        content: '服务器正在加载基础信息,请稍后...'
                    });
                },
                complete: function () {
                    $.omMessageBox.waiting("close");
                },
                success: function (data) {
                    comboxFeeTypeData = []
                    $.each(data, function (index, value) {
                        comboxFeeTypeData.push({ code: value.PayTypeCode, name: value.PayTypeName });
                    })
                    $('#PayTypeCode', detailForm).omCombo({
                        dataSource: comboxFeeTypeData,
                        valueField: 'code',
                        optionField: 'name',
                        inputField: 'name'
                    });
                },
                error: function (result) {
                    goOn = false;
                    $.omMessageBox.waiting("close");
                    $.omMessageBox.alert({
                        content: '发现错误<BR>：' + result.status
                    });
                }
            });
            $('span#button-save', detailForm).omButton({
                icons: { left: '../Content/Images/List/accept.png' }, width: 80,
                onClick: function () {
                    $.ajax({
                        cache: false, async: false,
                        url: '../handler/ajax.ashx?type=AjaxSystem&method=CostPay',
                        dataType: 'json', type: 'post',
                        data: { UID: art.dialog.data('UID'), PayTypeCode: $("#PayTypeCode").val(), AccountNo: $("#AccountNo").val(), CheckNo: $("#CheckNo").val(), USERID: art.dialog.data('currentUID') },
                        beforeSend: function () {
                            $.omMessageBox.waiting({
                                title: '请等待',
                                content: '系统正在提交,请稍后...'
                            });
                        },
                        complete: function () {
                            $.omMessageBox.waiting("close");
                        },
                        success: function (data) {
                            if (data.IsError) {
                                $.omMessageBox.alert({
                                    content: '错误：' + data.Message
                                });
                            }
                            else {
                                $.omMessageBox.alert({
                                    content: data.Message,
                                    onClose: function () {
                                        art.dialog.close();
                                    }
                                });
                            }
                        },
                        error: function (result) {
                            $.omMessageBox.waiting("close");
                        }
                    });
                }
            });
            $('span#button-cancel', detailForm).omButton({
                icons: { left: '../Content/Images/List/cross.png' }, width: 80,
                onClick: function () {
                    art.dialog.close();
                }
            });
        });
    </script>
</head>
<body>
        <div id="center-panel">
    <div id="detail-form">
        <form id="viewForm">
            <table style="width:100%;">
                <tr>
                    <td align="right" style="width: 80px; color: red;">付款方式</td>
                    <td align="left" style="width: 180px">
                        <input type="text" class="input-text" name="PayTypeCode" id="PayTypeCode" /></td>
                    <td align="center" style="width: 80px;"><span id="button-save">保存</span></td>
                </tr>
                <tr>
                    <td align="right" style="width: 80px; margin-left: 10px; color: red;">银行账号</td>
                    <td align="left" style="width: 180px">
                        <input type="text" class="input-text" name="AccountNo" id="AccountNo" value="" style="width:100%;" maxlength="30" />
                    </td>
                    <td align="center" style="width: 80px;"><span id="button-cancel">取消</span></td>
                </tr>
                 <tr>
                    <td align="right" style="width: 80px; color: red;">支票号码</td>
                    <td align="left" style="width: 180px">
                        <input type="text" class="input-text" name="CheckNo" id="CheckNo" maxlength="10" /></td>
                    <td align="center" style="width: 80px;"></td>
                </tr>
            </table>
        </form>
    </div>
            </div>
</body>
</html>
